import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCmsFormFieldsController } from '../../../controllers';
const uctoocmsFormFieldsRouter = new Router();
const cmsFormFieldsController = new uctooCmsFormFieldsController();

uctoocmsFormFieldsRouter.post('/add', requireUser, cmsFormFieldsController.add);
uctoocmsFormFieldsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/cms_form_fields'), cmsFormFieldsController.edit);
uctoocmsFormFieldsRouter.post('/del', requireUser, rowLevelPermission('uctoo/cms_form_fields'), cmsFormFieldsController.delete);

//For getting cmsFormFields with permission control
uctoocmsFormFieldsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/cms_form_fields'), cmsFormFieldsController.getSingle);
uctoocmsFormFieldsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/cms_form_fields'), cmsFormFieldsController.getMany);
uctoocmsFormFieldsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/cms_form_fields'), cmsFormFieldsController.getMany);

//#endregion AutoCreateCode
export default uctoocmsFormFieldsRouter;
